/*
 * @Author: CodeHare
 * @Date: 2023-10-26 10:38:00
 * @LastEditors: yangni 920556271@qq.com
 * @LastEditTime: 2023-12-11 15:02:11
 * @Description: 
 */
import 'package:bruno/bruno.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:yt_devops/components/app_bar/app_bar_widget.dart';
import 'package:yt_devops/components/log_utils.dart';
import 'package:yt_devops/pages/site/site_observer_list/views/my_top_tabbar.dart';
import 'package:yt_devops/pages/site/site_setting/siet_elec_price_setting/site_elec_price_setting_controller.dart';
import 'package:yt_devops/pages/site/site_setting/siet_elec_price_setting/site_mains_elec_detail/keep_aliver_wrapper.dart';
import 'package:yt_devops/styles/styles.dart';

class SiteElecPriceSettingView extends GetView<SiteElecPriceSettingController> {
   SiteElecPriceSettingView({Key? key}) : super(key: key);
   @override
  final controller = Get.put(SiteElecPriceSettingController());

  @override
  Widget build(BuildContext context) {


    return GetBuilder<SiteElecPriceSettingController>(
      init: controller,
        builder: (_) {
          Log.d('SiteElecPriceSettingController===${controller}');
          controller.handleTabIndex();
          return Scaffold(
        appBar: AppBarWidget.withRightActions(
          controller.title,
          actions: [
            Visibility(
                      visible: controller.isShowAdd,
                      child: IconButton(
                        iconSize: 26,
                        icon: const Icon(Icons.add),
                        onPressed: controller.addNewElecPriceRule,
                      )),

          ],
        ),
        body:  Column(
            children: [
              Column(children: [
                Container(
                  padding: const EdgeInsets.fromLTRB(0, 0, 10, 0),
                  color: Colour.white,
                  width: ScreenUtil().screenWidth,
                  alignment: Alignment.center,
                  child:  MyTopTabBar(controller.tabController, controller.tabs)
                ),
              ]),
              // Expanded(
              //   child: KeepAliveWrapper(TabBarView(
              //       controller: controller.tabController,
              //       children: controller.tabViews
              //   )),
              // )
            ],
          ),
      );});

  }

}
